import time
from concurrent.futures import ThreadPoolExecutor,ProcessPoolExecutor


URLS=[
    'https://www.baidu.com',
    'https://www.cnn.com',
    'https://www.bbc.co.uk'
]
def work(url):
    for i in range(10):
        time.sleep(0.5)
        print(f"-----{i}------{url}")


if __name__ == '__main__':
    with ProcessPoolExecutor(max_workers=5) as tp:
        for i in URLS:
            tp.submit(work,i)
        tp.shutdown(wait=True)

    print("----主线程-----")